package com.ethink.order.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.TobSaleDetailOrderInfo;
import com.ethink.order.api.info.TobSaleOrderInfo;
import com.ethink.order.api.model.TobSaleAndSettleModel;
import com.ethink.order.api.model.TobSaleOrderGoodsModeModel;
import com.ethink.order.api.model.TobSaleOrderModel;
import com.ethink.order.api.request.*;
import com.ethink.order.api.response.TobSaleOrderAddResponse;
import com.ethink.order.api.response.TobSaleOrderDetailResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * TOB销售单 Facade接口
 *
 * @author default
 * @date 2022-11-16
 */
@FeignClient(name = "ethink-order-service", path = "order-service/facade/v1/tobSaleOrder", contextId = "tobSaleOrderFacade")
public interface TobSaleOrderFacade {

    @PostMapping("/addTobSaleOrder")
    @ResponseBody
    TobSaleOrderAddResponse addTobSaleOrder(@RequestBody TobSaleOrderAddRequest request);

    @PostMapping("/pageQueryTobSaleOrder")
    @ResponseBody
    Page<TobSaleOrderModel> pageQueryTobSaleOrder(@RequestBody TobSaleOrderPageQueryRequest request);

    @GetMapping("/queryDetailTobSaleOrder")
    @ResponseBody
    TobSaleOrderDetailResponse queryDetailTobSaleOrder(@RequestParam("id") Long id, @RequestParam("table") Integer table);

    @GetMapping("/deleteTobSaleOrder")
    @ResponseBody
    void deleteTobSaleOrder(@RequestParam("id") Long id);

    @PostMapping("/updateTobSaleOrder")
    @ResponseBody
    Integer updateTobSaleOrder(@RequestBody TobSaleOrderUpdateRequest request);

    @GetMapping("/queryTobSaleOrderById")
    @ResponseBody
    TobSaleOrderInfo queryTobSaleOrderById(@RequestParam("id") Long id);

    @GetMapping("/getTobSaleOrderInfoByOrderNo")
    @ResponseBody
    TobSaleOrderInfo getTobSaleOrderInfoByOrderNo(@RequestParam("orderNo") String orderNo);

    @PostMapping("/tobSaleAndSettlePageQuery")
    @ResponseBody
    Page<TobSaleAndSettleModel> tobSaleAndSettlePageQuery(@RequestBody TobSaleAndSettlePageQueryRequest request);

    @PostMapping("/updateTobSaleOrderStatus")
    @ResponseBody
    void updateTobSaleOrderStatus(@RequestBody TobSaleOrderSetStatusRequest request);

    @PostMapping("/checkSettleImport")
    @ResponseBody
    Boolean checkSettleImport(@RequestBody TobSettleImportCheckRequest checkRequest);

    @PostMapping("/TobSaleOrderPoInsert")
    @ResponseBody
    Integer TobSaleOrderPoInsert(@RequestBody TobSaleOrderPoInsertRequest request);

    @GetMapping("/queryDetailListByOrderNo")
    @ResponseBody
    List<TobSaleDetailOrderInfo> queryDetailListByOrderNo(@RequestParam("orderNo") String orderNo);

    @PostMapping("/queryTobSaleDetailOrderNosByOrderNo")
    @ResponseBody
    List<String> queryDetailOrderNoByOrderNo(@RequestBody List<String> orderNos);

    /**
     * 财务结算
     *
     * @param id
     */
    @GetMapping("/settleOrder")
    @ResponseBody
    void settleOrder(@RequestParam("id") Long id);

    /**
     * 分页查询
     *
     * @param request
     * @return
     */
    @PostMapping("/pageQueryTobSaleOrderPageMode")
    @ResponseBody
    Page<TobSaleOrderGoodsModeModel> pageQueryTobSaleOrderPageMode(@RequestBody TobSaleOrderPageGoodsModeQueryRequest request);

}